Repository navigation
CollectiveX: time the pair period without events between pairs / CollectiveX:pair period 计时不再在 pair 之间插入 event - #5039
Merged
Conversation
The published pair period was a window between two CUDA events around one dispatch+combine pair. An event node costs device time of its own, so the window read above what back-to-back pairs cost: 4.5-13.5 us at T=1 on NVIDIA EP8 and about 6 us on AMD, roughly constant in T. Each chain trial now runs a third sibling, the span chain, with one event before its first kept pair and one after its last. Its time per pair sets the period's level; the pair windows, shifted onto it per trial, keep the pair-to-pair spread. chain_health.window_overhead_us reports what the windows read above the span, and the component's origin becomes chained-span-median. Also: - swap-blocks profiles take 40 iterations per point instead of 100; - an error that is not finite (NaN output, shape mismatch) is written as null beside its failed verdict instead of crashing the result writer; - methodology: the chain floors can sum to more than the pair period, and bandwidth is a per-GPU rate.
… swap-blocks changes
…s are captured Keeps at most two chain graphs alive at once, as before the span chain was added.
Contributor
|
Claude finished @Oseltamivir's task in 1m 7s —— View job Review of PR #5039
LGTM - no blocking issues found. What I checked
I couldn't run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pair_period, the CollectiveX headline, read 12–26% too high at small batches. It was the window between two CUDA events around one dispatch+combine pair, and an event node costs device time of its own: two adjacent event nodes in a replayed graph sit 2.4–3.3 µs apart on NVIDIA GPUs and about 6 µs on AMD, and a window around real kernels carries more. An engine's decode graph has no event between its layers.Measured on all nine pools with a chain whose only events are at its two ends (EP8 decode BF16, T=1, µs):
MoRI: MI300X 47.3 → 41.5, MI325X 47.0 → 41.3, MI355X 48.9 → 42.4. The extra is 4.5–13.5 µs on NVIDIA and about 6 µs on AMD, differs by pool and library, and stays roughly constant up the ladder (2–11% at T=512). The fastest library at T=1, 8 and 64 is the same on every pool either way.
Change
pair_period's level (cross-rank median). The pair windows keep the spread: each trial's windows are shifted so their median sits at that trial's span value, and the percentiles are taken over the shifted windows.chain_health.window_overhead_usreports what the pair windows read above the span, andpair_period.originbecomeschained-span-median. InferenceX-app reads neither field today.invalidwith the magnitudenull.Impact
Every published EP row needs re-measuring. Rows measured before this PR carry
pair_period.origin: chained-medianand read high by the amounts above; a subtraction cannot correct them, because the extra depends on pool and library. Fresh-entryroundtrip,dispatch,combineand the chain floors are still single windows and keep their events' cost, which matters only at small batches. The 18 swap-blocks rows also need a re-run at 40 iterations.Validation
Hand runs from the pools' login nodes (no Actions run). This branch's harness reproduces the events-at-the-ends probe,
pair_periodp50 at T=1 in µs: B200 FlashInfer-EP 23.48 (probe 23.45), B200 DeepEP V2 42.91 (42.78), H200 NCCL-EP LL 20.78 (20.69), MI325X MoRI 41.28 (41.27), MI325X UCCL-EP eager 244.6 (242.3). Every decode rung of the four graphed cases agrees with the probe within 1.1 µs, and the eager case within 1.5%.The final commit then ran clean, from a clean checkout, on B200 (FlashInfer-EP BF16 and FP8, DeepEP V2 low-latency, DeepEP V2 two-node EP16, NCCL-EP normal, UCCL-EP low-latency, swap-blocks), MI325X (MoRI EP8 and low-latency EP16) and GB300 (NCCL-EP low-latency EP16): 17 EP cases and both swap-blocks cases, all
success. Each newpair_periodequals the published value minus that case'swindow_overhead_us(for example DeepEP V2 low-latency on B200 at T=1: 50.6 → 42.6, overhead 8.0).Validation details
success. Each chain trial captured the period chain again with one event window per 1, 2, 4, 8, 16, 56 and 112 pairs; a window of N pairs fitsN × pair + constantwithin 0.4 µs for FlashInfer-EP and 1 µs for DeepEP V2, and the 112-pair value agrees across ranks and trials to 0.01 µs.中文
CollectiveX 的主指标
pair_period在小 batch 下偏高 12–26%。它原先是一对 dispatch+combine 前后两个 CUDA event 之间的窗口,而 event 节点本身要占用设备时间:在重放的 graph 中,两个相邻 event 节点在 NVIDIA GPU 上相隔 2.4–3.3 µs,在 AMD 上约 6 µs,包住真实 kernel 的窗口代价更大。推理引擎的 decode graph 在各层之间并没有 event。在全部九个资源池上,用只在首尾各放一个 event 的链重新测量(EP8 decode BF16,T=1)的结果见上表:NVIDIA 上多出 4.5–13.5 µs,AMD 上约 6 µs,随资源池和库而异,并且沿 token 阶梯基本保持不变(T=512 时为 2–11%)。各资源池在 T=1、8、64 下最快的库不变。
改动
pair_period的水平(跨 rank 取中位数);逐 pair 窗口只提供离散程度:每个 trial 的窗口整体平移,使其中位数落在该 trial 的 span 值上,再对平移后的窗口取百分位。chain_health.window_overhead_us,即逐 pair 窗口比 span 高出的部分;pair_period.origin改为chained-span-median。InferenceX-app 目前不读取这两个字段。invalid结束,误差值记为null。影响
所有已发布的 EP 结果都需要重新测量。 本 PR 之前测得的行带有
pair_period.origin: chained-median,偏高幅度如上;由于偏差随资源池和库变化,无法用减法修正。fresh-entry 的roundtrip、dispatch、combine以及 chain floors 仍是单个窗口,仍含 event 的代价,只在小 batch 下有影响。18 行 swap-blocks 结果也需按 40 次迭代重跑。验证
在各资源池登录节点手动运行(无 Actions 运行)。本分支的测试框架复现了首尾 event 探针的结果,T=1 的
pair_periodp50(µs):B200 FlashInfer-EP 23.48(探针 23.45)、B200 DeepEP V2 42.91(42.78)、H200 NCCL-EP LL 20.78(20.69)、MI325X MoRI 41.28(41.27)、MI325X UCCL-EP eager 244.6(242.3)。四个 graph case 的每个 decode 档位与探针相差均在 1.1 µs 以内,eager case 在 1.5% 以内。随后用最终提交、在干净的检出上再次运行:B200(FlashInfer-EP BF16 与 FP8、DeepEP V2 低延迟、DeepEP V2 双节点 EP16、NCCL-EP normal、UCCL-EP 低延迟、swap-blocks)、MI325X(MoRI EP8 与低延迟 EP16)和 GB300(NCCL-EP 低延迟 EP16),共 17 个 EP case 和两个 swap-blocks case,全部
success。每个新的pair_period都等于已发布值减去该 case 的window_overhead_us(例如 B200 上 DeepEP V2 低延迟在 T=1:50.6 → 42.6,overhead 8.0)。AI model disclosure
claude-mythos-5-2: found the overhead in the published data, designed and ran the probe and the validation runs, and wrote the change, tests, docs, diagrams and this description.claude-mythos-5-2(delegated review agent): found the result-writer crash and the two methodology errors during an audit.